#pragma once
#include "core/fixedvector.h"

struct vertexelement_t
{
	uint32 elemnum;
	uint32 type;
	uint32 size;
	uint32 milyen;

	vertexelement_t();
	vertexelement_t(uint32 num,const stringhash& id,int fajta);

};

enum
{
	VDECL_POS = (1<<0),
	VDECL_NORMAL = (1<<1),
	VDECL_TANGENT = (1<<2),
	VDECL_COLOR = (1<<3),
	VDECL_UV = (1<<4)
};

struct vertexdeclaration_t
{
	stringhash name;
	fixedvector<vertexelement_t,8> elementlist;
	uint32 vertexsize;

	void generate(const stringhash& name,vertexelement_t* elem,int elemnum);
	uint32 generate_hwid();
	void set(uint32 _offset);
//	void set();

	//hash dolgok

	uint32 gethashkey() const{return name.value;}
	vertexdeclaration_t* nextinhashmap;
	uint32 flag;
};


